import AlipaySdk from 'alipay-sdk';
import { appid, private_key, sign_type } from './config';

export default async function get_user_info(auth_token: string) {
	return new Promise(async (resolve, _reject) => {
		const ali = new AlipaySdk({
			appId: appid,
			privateKey: private_key,
			signType: sign_type
		});

		const res = await ali.exec('alipay.user.info.share', {
			auth_token
		});
		resolve(res)
	});
}
